package com.example.demo;

import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;

public class Demo2 {
    @RequestMapping("/getC2")
    public String getCookie2(@CookieValue("name") String name){
        return "从Cookie中获取值, name:"+name;
    }
}
